from django.contrib import admin
from app import models
# Register your models here.
class UserrAdmin(admin.ModelAdmin):
    list_display = ["user_name","starus","phone"]
    search_fields = ["user_name"]
    list_filter = ["user_name"]
admin.site.register(models.User,UserrAdmin)
class GoodsAdmin(admin.ModelAdmin):
    list_display = ["good_name","img_url","price","intro"]
    search_fields = ['good_name']
    list_filter = ["good_name"]
admin.site.register(models.Goods,GoodsAdmin)
class TypeAdmin(admin.ModelAdmin):
    list_display = ['type_name']
admin.site.register(models.Type,TypeAdmin)
class AddressAdmin(admin.ModelAdmin):
    list_display = ["user_name","address","phone"]
    search_fields = ['user_name']
    list_filter = ["user_name"]
admin.site.register(models.Address,AddressAdmin)
class OrderAdmin(admin.ModelAdmin):
    list_display = ["order_no","user_name","phone","address",'tootal_price']
    search_fields = ['user_name','phone']
    list_filter = ["user_name",'phone']
admin.site.register(models.Order,OrderAdmin)
admin.site.site_header ='天天生鲜后台管理'